package com.ton.common.convertor;

import com.ton.common.controller.order.req.PayOrderAddReq;
import com.ton.common.controller.order.req.PayOrderReq;
import com.ton.common.controller.order.resp.PayOrderQueryResp;
import com.ton.common.controller.order.resp.PayOrderResp;
import com.ton.common.controller.order.resp.QueryOrderResp;
import com.ton.common.entity.TonPayOrder;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @description: 订单对象转换器
 * @author: gityyge
 * @create: 2024-03-19 13:40
 **/
@Mapper
public interface OrderConvertor {
    OrderConvertor MAPPER = Mappers.getMapper(OrderConvertor.class);

    //Req -> Entity
    TonPayOrder ob2en(PayOrderReq req);

    //AddReq -> Entity
    TonPayOrder ob2en(PayOrderAddReq req);

    //Edit -> Entity
//    Order ob2en(OrderEditReq req);
    PayOrderResp en2resp(TonPayOrder anchor);

    //将实体类转化为收银台的订单对象
    PayOrderQueryResp en2QueryResp(TonPayOrder anchor);

//    List<PayOrderResp> ob2respArr(List<PayOrder> list);

    List<QueryOrderResp> ob2respArr(List<TonPayOrder> list);
}
